let p = new MyPromise((resolve, reject) => {
    setTimeout(() => {
        reject(2000)
    }, 1000);
});

// p.then(undefined, reason => console.log("P1 reason: ", reason));
// p.then(undefined, reason => console.log("P2 reason: ", reason));

let p3 = new MyPromise((resolve, reject) => {
    setTimeout(() => {
        resolve(3000)
    }, 3000);
});

let p2 = MyPromise.resolve(1000);

// MyPromise.all([p, p2, p3]).then(results => {
//     console.log(results);
// }, reason => {
//     console.log("Failed", reason);
// });

MyPromise.race([p, p3]).then(results => {
    console.log(results);
}, reason => {
    console.log("Failed", reason);
});

MyPromise.allSettled([p, p2, p3]).then(results => {
    console.log(results);
}, reason => {
    console.log("Failed", reason);
});